<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\widgets\Breadcrumbs;
use app\modules\core\widgets\SlideNav;
?>
<div class="container-fluid">
	<div class="row">
        <?= SlideNav::widget() ?>
		<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 col-lg-10 col-lg-offset-2 main">
            <?= Breadcrumbs::widget([
                'homeLink' => ['label' => 'HOME', 'url' => '/core'],
                'links' => [
                    ['label' => '内容', 'url' => '/core/content/list'],
                    '编辑',
                ]
            ]) ?>

			<div class="row">
				<div class="col-md-12 col-lg-12">
					<div class="alert alert-warning" role="alert">
						<button type="button" class="close" data-dismiss="alert">×</button>
						<strong>警告!</strong> 请注意你的个人隐私安全.
					</div>
                    <?php
                        $form = ActiveForm::begin(
                            [
                                'options' => ['class' => 'form-horizontal'],
                                'method' => 'POST',
                                'fieldConfig' => [
                                    'labelOptions' => ['class' => 'col-md-1 control-label'],
                                    'template' => '{label}<div class="col-md-2 controls">{input}</div>{hint}{error}',
                                ],
                            ]
                        );

                        echo Html::hiddenInput('id', $content['id']);
                        
                        foreach ($model->getFieldSet() as $field) {
                            echo $form->field($content, $field->id)->{$field['widget']}();
                        }

                        echo '<a type="button" class="btn btn-default" href="/core/content/delete?id=' . $content['id'] . '">删除</a>';
                        echo Html::submitButton('提交', ['class' => 'btn btn-primary', 'name' => 'login-button']);
                    
                        ActiveForm::end();
                    ?>
				</div>
			</div>
		</div>
	</div>
</div>
